package com.qf.controller;

import com.qf.pojo.Admin;
import com.qf.pojo.R;
import com.qf.pojo.UserDto;
import com.qf.service.AdminService;
import com.sun.deploy.net.HttpResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpRequest;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;


@Controller
@RequestMapping("admin")
public class AdminController {
    @Autowired
    private AdminService adminService;

    @RequestMapping("login.do")
    @ResponseBody
    public R login(UserDto dto, HttpSession session){
        return adminService.login(dto,session);
    }

    //注销
    @RequestMapping("loginout.do")
    public void logionOut(HttpSession session){
        adminService.loginout(session);
    }
}
